import java.util.ArrayList;
import java.util.Date;
public abstract class TopicModel {
	//public static ccmixauthortopicPerplexity alist;
	protected double llh;

	public double getLlh() {
		return llh;
	}
	protected double pda;
	public double getpda() {
		return pda;
	}
	public void run(int iters, String filename) throws Exception {
		readDocs(filename);  
		initialize();
		
		System.out.println("["+(new Date())+"]_"+"Sampling...");
		
//		for (int iter = 1; iter <= iters; iter++) {
//		
//			//System.out.print(iter+",");
//			doSampling();
//			perplex(iter);
//		}
//		System.out.println();
//		
//		System.out.println("["+(new Date())+"]_"+"Final Log-Likehood...");
//		likelihood();
//		
//		prediction();
//		// write variable assignments

		writeOutput(filename);

		System.out.println("["+(new Date())+"]_"+"...done.");
	}
	
	public abstract void initialize();
	
	public abstract void doSampling();
	
	public abstract void readDocs(String filename) throws Exception;
	
	public abstract void writeOutput(String filename) throws Exception;
	
	public void prediction()
	{
		System.out.println("prediction() isn't been implemented!!!!!");
	}
	public void likelihood()
	{
		System.out.println("likelihood() isn't been implemented!!!!!");
	}

	public void perplex(int iter)
	{
	}
}
